<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
  let a=[q,w,e,r,t,t,yy,y,y,uu,i,i]
  let b=[1,2,4,5]
  var array1 = array.sort((a, b) => a > b ? -1 : a < b ? 1 : 0);
  
  array1.forEach(item=>{
   arr.splice(item,1)
  })
  console.log(arr)
    </script>
    
</body>
</html>